package net.sansi.v3correctserver.service.correctresult.convert;

import net.sansi.v3correctserver.entity.screen.ScanBoard;
import net.sansi.v3correctserver.service.space.ProjectSpace;
import net.sansi.v3correctserver.util.Matrix;

import java.nio.file.Path;
import java.util.List;

/**
 * Created by Fang
 * create time : 2025/2/26
 * IDE : IntelliJ IDEA
 * <p>
 * CL 文件
 * 1. 扫描板系数文件
 */

public class FactorToCFConvert extends FactorConvert<ScanBoard> {

    private final ProjectSpace projectSpace;
    private final ScanBoard scanBoard;

    /**
     * 构造函数
     *
     * @param scanBoard    扫描板
     * @param results      结果
     * @param is3Factor    是否是3系数
     * @param projectSpace 项目空间
     */
    public FactorToCFConvert(
            ScanBoard scanBoard,
            List<Matrix<double[]>> results,
            boolean is3Factor,
            ProjectSpace projectSpace
    ) {
        super(scanBoard, results, is3Factor);
        this.projectSpace = projectSpace;
        this.scanBoard = scanBoard;
    }

    @Override
    Path genFilePath(ScanBoard section) {
        return projectSpace.factorCF(scanBoard.getId());
    }

}
